package com.imooc.articles_mongodb_project.entity;

import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.util.Date;

@Data
@Document(collection = "articles")
@Accessors(chain = true)
public class Articles implements Serializable {

    @Id
    private String id;

    @Field("title")
    private String title;
    @Field("auth_name")
    private String authName;
    @Field("content")
    private String content;
    @Field("date")
    private Date date;

}
